#pragma once
#include <BWAPI.h>
#include <string>
#include <vector>
//Class containing static utility methods for the starcraft world.
// These are helper methods used by other functions.

class StarUtil
{
	
public:
	static bool isMelee(BWAPI::UnitType& unit);

	

	static bool unitCanAttack(const std::string& attacker,
		const std::string& target);
	
	// Returns a reference to the palyer unit types
	static std::vector<std::string>& getPlayerTypes();

	// Returns a reference to the enemy unit types
	static std::vector<std::string>& getEnemyTypes();

	static std::map<std::string, std::vector<BWAPI::Unit*>*>& getPlayerGroups();

	static std::map<std::string, std::vector<BWAPI::Unit*>*>& getEnemyGroups();
 
	static void getUnitGroups(BWAPI::Player* player, 
		std::map<std::string, std::vector<BWAPI::Unit*>*>& playerGroups);

	static void getUnitTypes(BWAPI::Player * player,
		std::vector<std::string> &unitTypes);

	//Returns the ennemy Player
	static BWAPI::Player* getEnemy();

	// Takes the string name of an attacker and a target and 
	// returns the BWAPI::WeaponType the attacker will use on its target
	static BWAPI::WeaponType getWeapon(const std::string& attacker, 
		const std::string& target);

	static void deleteValues();

	// Returns a the unit types of the player in the current battle
	static std::vector<std::string> getSelfUnitTypes();

};
